<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition template="/template/DefaultTemplate.xhtml">
        <ui:define name="title">
            <h:outputText value="Sales Operation Plans"></h:outputText>
        </ui:define>
        <ui:define name="content">
            <h:form prependId="false">
                <p:panel header="Sales Operation Plans">
                <h:panelGroup rendered="#{masterProductionScheduleMonthlyEntityController.items.rowCount > 0}">
                    <p:dataTable value="#{masterProductionScheduleMonthlyEntityController.items}" 
                                     var="item" style="table-layout:fixed"
                                     paginator="true" rows="10"
                                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                     rowsPerPageTemplate="5,10,15">
                        <p:column filterBy="#{item.type}">
                            <f:facet name="header">
                                <h:outputText value="Period"/>
                            </f:facet>
                            <h:outputText value="#{item.type}"/>
                        </p:column>
                        <p:column filterBy="#{item.yearOfProduction}">
                            <f:facet name="header">
                                <h:outputText value="Year"/>
                            </f:facet>
                            <h:outputText value="#{item.yearOfProduction}"/>
                        </p:column>
                        <p:column>
                                <f:facet name="header">
                                    <h:outputText value="&nbsp;"/>
                                </f:facet>
                                <p:commandButton image="ui-icon ui-icon-search" action="#{masterProductionScheduleMonthlyEntityController.prepareView}" ajax="false"/>
                            </p:column>
                    </p:dataTable>
                </h:panelGroup>
                </p:panel>
                <p:commandButton ajax="false" action="#{masterProductionScheduleMonthlyEntityController.prepareCreate}" value="Create Sales Operation Plan"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
